#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef double db;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout);
#define pb push_back

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int N = (1 << 24) + 10;

ll F[N],n,ans;

int popcnt(int x){int res=0;for(;x;x>>=1)res+=x&1;return res;}

int main (){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in;
	for(int i = 1;i <= n;i++){
		char s[3]; scanf("%s",s+1);
		int st = 0; for(int j = 1;j <= 3;j++) st |= 1 << (s[j] - 'a');
		for(int k = st;k;k = (k - 1) & st) F[k] += (popcnt(k) & 1? 1 : -1);
	}
	for(int i = 0;i < 24;i++)
		for(int j = 0;j < (1 << 24);j++)
			if(j >> i & 1)
				F[j] += F[j^1<<i];
	for(int i = 0;i < (1<<24);i++) ans = ans ^ (F[i] * F[i]);
	printf("%d\n",ans);
	return 0;
}

